<?php

/**
 * InfractionView
 */
require_once 'Application/Controllers/InfractionController.php';
class Application_Views_InfractionView{
    
   public function formInsert(){
        include_once 'Application/Views/infraction/insertInfraction.php';
        
    }
    
   public function formListInfraction($msg){
        ?>
        <div>
            
            <h1> <?php echo "$msg";  ?> </h1>
        </div>
<?php }

   public function showInfraction($consult){
        //include_once 'Application/Views/view/header.php';        
        
                $num=count($consult);
?>
        <center>
            <table border="1">
                    <tr>
                            <td>COD.INFRAC.</td>
                            <td>PLACA</td>
                            <td>TIPO</td>
                            <td>INFRACTOR</td>
                            <td>FECHA</td>
                            <td>LUGAR</td>
                            <td>PRECIO</td>
                            <td>DESCRIPCION</td>
                            <td>Opcion</td>
                    </tr>
                    <?php
                    for($i=0;$i<$num;$i++){?>
                    <tr>                    
                            <td><?php echo $consult[$i][0];?></td>
                            <td><?php echo $consult[$i][1] ?></td>
                            <td><?php echo $consult[$i][2] ?></td>
                            <td><?php echo $consult[$i][3] ?></td>  
                            <td><?php echo $consult[$i][4] ?></td>
                            <td><?php echo $consult[$i][5] ?></td>
                            <td><?php echo $consult[$i][6] ?></td>
                            <td><?php echo $consult[$i][7] ?></td>
                            <td><input type="button" value="Modificar" 
                                        onclick="window.open(
                                        'Application/Views/infraction/modifyInfraction.php?idInfraction=<?php echo base64_encode($consult[$i][0]); ?>','content');"> 
                            </td>
                    </tr>
                    <?php }?> 
            </table>
           <!-- <div>
                <?php include_once 'Application/Views/view/botonInicio.php'; //$this->inicio();  ?>
            </div>-->
        </center>
<?php }

   public function formModify(){
       header("Location: Application/Views/infraction/modifyInfraction.php");   
   }

}